Skip to content

Initial AHKv1 -> AHKv2 auto-conversion#1

Draft
donaldguy wants to merge 2 commits intooctopus-open-RedBearAK-windows-PRsfrom
ahk-1-to-2
Draft

Initial AHKv1 -> AHKv2 auto-conversion#1
donaldguy wants to merge 2 commits intooctopus-open-RedBearAK-windows-PRsfrom
ahk-1-to-2

Conversation

@donaldguy
Copy link
Owner

@donaldguy donaldguy commented Apr 26, 2025

  1. Landed set of open, useful PRs that modify windows\kinto.ahk (Roll-up of RedBearAK's open windows PRs (AHKv1) rbreaves/kinto#899)

  2. Enabled all layouts as a vscode (though one could also use powershell -replace as below in 3):

  • Find: ; (.*; (?:Default|MacModifiers|WinModifiers|Chromebook|CB/IBM|IBM).*)
  • Replace: $1
  1. Ran mmikeww/AHK-v2-script-converter's v2converter.ahk on windows\kinto.ahk using AutoHotKey v2.0.19[^1] on windows\kinto.ahk, windows\detectUSB.ahk

  2. git rev-parse --show-toplevel | Set-Location
    Copy-Item .\windows\kinto_newV2.ahk .\windows\kinto.ahk
    Copy-Item .\windows\detectUSB_newV2.ahk .\windows\detectUSB.ahk
    # or Move-Item if you prefer, I copied so I could continue to use the convertor diff UI
    
    $redisabled = Get-Content .\windows\kinto.ahk | ForEach-Object {$_ -replace '^(\s*)([^;]+?; (?:Default|MacModifiers|WinModifiers|Chromebook|CB/IBM|IBM).*)','$1; $2' }
    $redisabled | Out-File .\windows\kinto.ahk
    
    # Note that presence of `git config --global core.autocrlf true` has removed Carriage Returns on the (inconsistent) lines they were present on
    git status --porcelain | Select-String -Pattern '^\sM\s(.*)' | ForEach-Object {git add $_.Matches.Groups[1].Value}
    # or, you know, git commit -a

0. Landed set of open, useful PRs that modify `windows\kinto.ahk` (rbreaves#899)

1. Enabled all layouts as a vscode (though one could also use powershell `-replace` as below in 3):
  Find: `; (.*; (?:Default|MacModifiers|WinModifiers|Chromebook|CB/IBM|IBM).*)`
  Replace: `$1`

2. Ran [mmikeww/AHK-v2-script-converter](https://github.com/mmikeww/AHK-v2-script-converter)'s [`v2converter.ahk`](https://github.com/mmikeww/AHK-v2-script-converter/blob/master/v2converter.ahk) on `windows\kinto.ahk` using AutoHotKey v2.0.19[^1] on `windows\kinto.ahk`, `windows\detectUSB.ahk`

3.
    ```powershell
    git rev-parse --show-toplevel | Set-Location
    Copy-Item .\windows\kinto_newV2.ahk .\windows\kinto.ahk
    Copy-Item .\windows\detectUSB_newV2.ahk .\windows\detectUSB.ahk
    # or Move-Item if you prefer, I copied so I could continue to use the convertor diff UI

    $redisabled = Get-Content .\windows\kinto.ahk | ForEach-Object {$_ -replace '^(\s*)([^;]+?; (?:Default|MacModifiers|WinModifiers|Chromebook|CB/IBM|IBM).*)','$1; $2' }
    $redisabled | Out-File .\windows\kinto.ahk

    # Note that presence of `git config --global core.autocrlf true` has removed Carriage Returns on the (inconsistent) lines they were present on
    git status --porcelain | Select-String -Pattern '^\sM\s(.*)' | ForEach-Object {git add $_.Matches.Groups[1].Value}
    # or, you know, git commit -a
    ```

[^1]: (installed via `winget install AutoHotKey.AutoHotKey` but this is also the [version](https://community.chocolatey.org/packages/autohotkey.install) installed by

    https://github.com/rbreaves/kinto/blob/860e3e0820fb0572fa39c9c769f7823714a42e91/windows/autohotkey.ps1#L11

    and by extension by `setup.py`)
@donaldguy
Copy link
Owner Author

Haven't tested if it works -- or indeed just loads -- yet, but I need to go to bed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant